package com.ruoyi.system.service.impl;

import java.util.List;
import cn.hutool.core.util.ObjectUtil;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.LogUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.util.LoginUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AComplaintMapper;
import com.ruoyi.system.domain.AComplaint;
import com.ruoyi.system.service.IAComplaintService;

/**
 * ppz投诉Service业务层处理
 *
 * @author gf
 * @date 2024-11-23
 */
@Service
public class AComplaintServiceImpl implements IAComplaintService {
    @Autowired
    private AComplaintMapper aComplaintMapper;

    /**
     * 查询ppz投诉
     *
     * @param id ppz投诉主键
     * @return ppz投诉
     */
    @Override
    public AComplaint selectAComplaintById(Long id) {
        return aComplaintMapper.selectAComplaintById(id);
    }

    /**
     * 查询ppz投诉列表
     *
     * @param aComplaint ppz投诉
     * @return ppz投诉
     */
    @Override
    public List<AComplaint> selectAComplaintList(AComplaint aComplaint) {
        return aComplaintMapper.selectAComplaintList(aComplaint);
    }

    /**
     * 新增ppz投诉
     *
     * @param aComplaint ppz投诉
     * @return 结果
     */
    @Override
    public int insertAComplaint(AComplaint aComplaint) {
        aComplaint.setCreateTime(DateUtils.getNowDate());
        return aComplaintMapper.insertAComplaint(aComplaint);
    }

    /**
     * 修改ppz投诉
     *
     * @param aComplaint ppz投诉
     * @return 结果
     */
    @Override
    public int updateAComplaint(AComplaint aComplaint) {
        aComplaint.setUpdateTime(DateUtils.getNowDate());
    return aComplaintMapper.updateAComplaint(aComplaint);
    }

    /**
     * 批量删除ppz投诉
     *
     * @param ids 需要删除的ppz投诉主键
     * @return 结果
     */
    @Override
    public int deleteAComplaintByIds(Long[] ids) {
        return aComplaintMapper.deleteAComplaintByIds(ids);
    }

    /**
     * 删除ppz投诉信息
     *
     * @param id ppz投诉主键
     * @return 结果
     */
    @Override
    public int deleteAComplaintById(Long id) {
        return aComplaintMapper.deleteAComplaintById(id);
    }

    /**
     * 批量逻辑删除ppz投诉
     *
     * @param ids 需要删除的ppz投诉主键
     * @return 结果
     */
    @Override
    public int logicDeleteAComplaintByIds(Long[] ids) {
        return aComplaintMapper.logicDeleteAComplaintByIds(ids);
    }
    /**
     * 逻辑删除ppz投诉信息
     *
     * @param id ppz投诉主键
     * @return 结果
     */
    @Override
    public int logicDeleteAComplaintById(Long id) {
        return aComplaintMapper.logicDeleteAComplaintById(id);
    }

    @Override
    public int insertAComplaintXcx(AComplaint aComplaint) {
        aComplaint.setUserId(LoginUtils.getUser().getId());
        aComplaint.setCreateTime(DateUtils.getNowDate());
        return aComplaintMapper.insertAComplaint(aComplaint);
    }

}
